/*     */ package com.iris.egrant.web.struts2.tags;
/*     */ 
/*     */ import com.iris.egrant.app.utils.IrisStringUtils;
/*     */ import freemarker.template.Configuration;
/*     */ import freemarker.template.Template;
/*     */ import java.io.Writer;
/*     */ import java.util.ArrayList;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import javax.servlet.jsp.JspException;
/*     */ import javax.servlet.jsp.tagext.BodyTagSupport;
/*     */ import net.sf.json.JSONSerializer;
/*     */ import org.springframework.context.i18n.LocaleContextHolder;
/*     */ import org.springframework.web.context.WebApplicationContext;
/*     */ import org.springframework.web.context.support.WebApplicationContextUtils;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class TreeAndCompleteForCodeTag
/*     */   extends BodyTagSupport
/*     */ {
/*     */   private static final long serialVersionUID = 1077194066541229822L;
/*  32 */   private String key = "";
/*     */   
/*  34 */   private String locale = "";
/*     */ 
/*     */   
/*  37 */   private String id = "";
/*     */ 
/*     */   
/*  40 */   private String checkable = "false";
/*     */ 
/*     */   
/*  43 */   private String cacheable = "true";
/*     */ 
/*     */   
/*  46 */   private String topCheckbox = "true";
/*     */   
/*  48 */   private String sqlParamVal = "";
/*     */   
/*  50 */   private String onClick = "";
/*     */ 
/*     */   
/*  53 */   private String value = "";
/*     */ 
/*     */   
/*  56 */   private List data = new ArrayList();
/*     */ 
/*     */ 
/*     */   
/*  60 */   private String width = "20px;";
/*     */ 
/*     */   
/*  63 */   private String className = "";
/*     */ 
/*     */   
/*  66 */   private String name = "";
/*     */   
/*  68 */   private String label = "";
/*     */ 
/*     */   
/*  71 */   private String maxLength = "";
/*     */   
/*  73 */   private String isFuzzy = "true";
/*     */   
/*     */   private String fuzzyQueryId;
/*     */   
/*     */   public String getFuzzyQueryId() {
/*  78 */     return this.fuzzyQueryId;
/*     */   }
/*     */   
/*     */   public void setFuzzyQueryId(String fuzzyQueryId) {
/*  82 */     this.fuzzyQueryId = fuzzyQueryId;
/*     */   }
/*     */   
/*     */   public String getOnClick() {
/*  86 */     return this.onClick;
/*     */   }
/*     */   
/*     */   public void setOnClick(String onClick) {
/*  90 */     this.onClick = onClick;
/*     */   }
/*     */ 
/*     */   
/*     */   public List getData() {
/*  95 */     return this.data;
/*     */   }
/*     */ 
/*     */   
/*     */   public void setData(List data) {
/* 100 */     this.data = data;
/*     */   }
/*     */   
/*     */   public String getCacheable() {
/* 104 */     return this.cacheable;
/*     */   }
/*     */   
/*     */   public void setCacheable(String cacheable) {
/* 108 */     this.cacheable = cacheable;
/*     */   }
/*     */   
/*     */   public String getSqlParamVal() {
/* 112 */     return this.sqlParamVal;
/*     */   }
/*     */   
/*     */   public void setSqlParamVal(String sqlParamVal) {
/* 116 */     this.sqlParamVal = sqlParamVal;
/*     */   }
/*     */   
/*     */   public String getCheckable() {
/* 120 */     return this.checkable;
/*     */   }
/*     */   
/*     */   public void setCheckable(String checkable) {
/* 124 */     this.checkable = checkable;
/*     */   }
/*     */   
/*     */   public String getLocale() {
/* 128 */     if (IrisStringUtils.isNullOrBlank(this.locale)) {
/* 129 */       return LocaleContextHolder.getLocale().toString();
/*     */     }
/* 131 */     return this.locale;
/*     */   }
/*     */   
/*     */   public void setLocale(String locale) {
/* 135 */     this.locale = locale;
/*     */   }
/*     */   
/*     */   public String getIsFuzzy() {
/* 139 */     return this.isFuzzy;
/*     */   }
/*     */   
/*     */   public void setIsFuzzy(String isFuzzy) {
/* 143 */     this.isFuzzy = isFuzzy;
/*     */   }
/*     */ 
/*     */   
/*     */   public int doStartTag() throws JspException {
/* 148 */     WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
/*     */ 
/*     */     
/* 151 */     Configuration cptFreemarkereConfiguration = (Configuration)context.getBean("cptFreemarkereConfiguration");
/*     */     
/*     */     try {
/* 154 */       String res = (String)this.pageContext.getAttribute("res");
/* 155 */       String ctx = (String)this.pageContext.getAttribute("ctx");
/*     */ 
/*     */       
/* 158 */       Map<String, Object> params = new HashMap<String, Object>();
/* 159 */       params.put("key", this.key);
/* 160 */       params.put("sqlParamVal", this.sqlParamVal);
/* 161 */       params.put("cacheable", this.cacheable);
/* 162 */       params.put("locale", getLocale());
/*     */       
/* 164 */       Map<String, Object> jsParams = new HashMap<String, Object>();
/*     */       
/* 166 */       jsParams.put("onClick", this.onClick);
/* 167 */       jsParams.put("checkable", this.checkable);
/* 168 */       jsParams.put("topCheckbox", this.topCheckbox);
/*     */       
/* 170 */       Map<String, Object> rootMap = new HashMap<String, Object>();
/* 171 */       rootMap.put("res", res);
/* 172 */       rootMap.put("ctx", ctx);
/* 173 */       rootMap.put("id", this.id);
/* 174 */       rootMap.put("id2", this.id.replaceAll("\\[.*\\]", ""));
/* 175 */       rootMap.put("value", this.value);
/* 176 */       rootMap.put("data", this.data);
/* 177 */       rootMap.put("width", this.width);
/* 178 */       rootMap.put("name", this.name);
/* 179 */       rootMap.put("label", this.label);
/* 180 */       rootMap.put("maxLength", this.maxLength);
/* 181 */       rootMap.put("isFuzzy", this.isFuzzy);
/* 182 */       rootMap.put("fuzzyQueryId", this.fuzzyQueryId);
/* 183 */       rootMap.put("params", JSONSerializer.toJSON(params).toString());
/* 184 */       rootMap.put("jsParams", JSONSerializer.toJSON(jsParams).toString());
/* 185 */       rootMap.put("className", this.className);
/* 186 */       rootMap.put("cleanIcon", (this.className != null && this.className.contains("btn_clean_icon")) ? "Y" : "N");
/* 187 */       Template template = cptFreemarkereConfiguration.getTemplate("treeAndCompleteForCode.ftl", "utf-8");
/*     */       
/* 189 */       template.process(rootMap, (Writer)this.pageContext.getOut());
/*     */     }
/* 191 */     catch (Exception e) {
/* 192 */       throw new JspException(e);
/*     */     } 
/*     */     
/* 195 */     return 0;
/*     */   }
/*     */ 
/*     */   
/*     */   public String getId() {
/* 200 */     return this.id;
/*     */   }
/*     */ 
/*     */   
/*     */   public void setId(String id) {
/* 205 */     this.id = id;
/*     */   }
/*     */   
/*     */   public String getValue() {
/* 209 */     return this.value;
/*     */   }
/*     */   
/*     */   public void setValue(String value) {
/* 213 */     this.value = value;
/*     */   }
/*     */   
/*     */   public String getKey() {
/* 217 */     return this.key;
/*     */   }
/*     */   
/*     */   public void setKey(String key) {
/* 221 */     this.key = key;
/*     */   }
/*     */   
/*     */   public String getWidth() {
/* 225 */     return this.width;
/*     */   }
/*     */   
/*     */   public void setWidth(String width) {
/* 229 */     this.width = width;
/*     */   }
/*     */   
/*     */   public String getClassName() {
/* 233 */     return this.className;
/*     */   }
/*     */   
/*     */   public void setClassName(String className) {
/* 237 */     this.className = className;
/*     */   }
/*     */   
/*     */   public String getName() {
/* 241 */     return this.name;
/*     */   }
/*     */   
/*     */   public void setName(String name) {
/* 245 */     this.name = name;
/*     */   }
/*     */   
/*     */   public String getLabel() {
/* 249 */     return this.label;
/*     */   }
/*     */   
/*     */   public void setLabel(String label) {
/* 253 */     this.label = label;
/*     */   }
/*     */   
/*     */   public String getTopCheckbox() {
/* 257 */     return this.topCheckbox;
/*     */   }
/*     */   
/*     */   public void setTopCheckbox(String topCheckbox) {
/* 261 */     this.topCheckbox = topCheckbox;
/*     */   }
/*     */   
/*     */   public String getMaxLength() {
/* 265 */     return this.maxLength;
/*     */   }
/*     */   
/*     */   public void setMaxLength(String maxLength) {
/* 269 */     this.maxLength = maxLength;
/*     */   }
/*     */ }


/* Location:              D:\文件kjt\WEB-INF\lib\egrant-core-2.2.20240205.1659.jar!\com\iris\egrant\web\struts2\tags\TreeAndCompleteForCodeTag.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */